//
//  CurrentEvent.m
//  Runone
//
//  Created by runone01 on 16/8/3.
//  Copyright © 2016年 runone. All rights reserved.
//

#import "CurrentEvent.h"

#define ImageHeight       64
#define BottomeMargin     5
#define lineMargin        5
#define MidMargin         5
@implementation CurrentEvent
{
    CGFloat _currentCellH ;
    CGFloat _historyCellH ;
    
    
    CGFloat _searchCurrentCellH ;
    CGFloat _searchHistoryCellH ;
}

- (CGFloat)currentCellH {
    if (!_currentCellH) {
        CGSize maxSize   = CGSizeMake([UIScreen mainScreen].bounds.size.width - 60, MAXFLOAT);

            CGFloat dealHeight = [self.DealDetail boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:14]} context:nil].size.height;
        _currentCellH = 100 +dealHeight;
    }
    return _currentCellH ;
}
- (CGFloat)historyCellH { //_historyCellH	CGFloat	88.3203125
    if (!_historyCellH) {
        CGSize maxSize     = CGSizeMake([UIScreen mainScreen].bounds.size.width - 60, MAXFLOAT);
       
            CGFloat dealHeight = [self.DealDetail boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:14]} context:nil].size.height;
            _historyCellH = 100 +dealHeight;
    }
    return _historyCellH ;
}



#pragma mark - 搜索时重新算一遍

- (CGFloat)searchCurrentCellH {
    if (!_searchCurrentCellH ) {
        CGSize     maxSize  =  CGSizeMake([UIScreen mainScreen].bounds.size.width - 60, MAXFLOAT);
        CGFloat dealHeight  = [self.DealDetail boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:14]} context:nil].size.height;
        _searchCurrentCellH =  100 +dealHeight;
    }
    return _searchCurrentCellH;
}
- (CGFloat)searchHistoryCellH {
    if (!_searchHistoryCellH) {
        CGSize maxSize     = CGSizeMake([UIScreen mainScreen].bounds.size.width - 60, MAXFLOAT);
        CGFloat dealHeight = [self.DealDetail boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:14]} context:nil].size.height;
        _searchHistoryCellH = 100 +dealHeight;
    }
    return _searchHistoryCellH;
}

@end
